package com.ruoyi.market.service.impl;

import com.ruoyi.market.domain.ConfigBase;
import com.ruoyi.market.mapper.ConfigBaseMapper;
import com.ruoyi.market.service.IConfigBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 店铺基本配置 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class ConfigBaseServiceImpl implements IConfigBaseService
{

    @Autowired
    private ConfigBaseMapper configBaseMapper;

    /**
     * 根据条件分页查询店铺基本配置列表
     * 
     * @param configBase 店铺基本配置信息
     * @return 店铺基本配置信息集合信息
     */
    @Override
    public List<ConfigBase> selectConfigBaseList(ConfigBase configBase)
    {
        return configBaseMapper.selectConfigBaseList(configBase);
    }

    /**
     * 通过店铺基本配置ID查询店铺基本配置
     * 
     * @param shopId 店铺ID
     * @return 店铺基本配置对象信息
     */
    @Override
    public ConfigBase selectConfigBaseByShopId(String shopId)
    {
        return configBaseMapper.selectConfigBaseByShopId(shopId);
    }

    /**
     * 新增保存店铺基本配置信息
     * 
     * @param configBase 店铺基本配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertConfigBase(ConfigBase configBase)
    {
        // 新增店铺基本配置信息
        int rows = configBaseMapper.insertConfigBase(configBase);
        return rows;
    }

    /**
     * 修改保存店铺基本配置信息
     * 
     * @param configBase 店铺基本配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int updateConfigBase(ConfigBase configBase)
    {
        return configBaseMapper.updateConfigBase(configBase);
    }

    /**
     * 批量删除店铺基本配置信息
     * 
     * @param configBaseIds 需要删除的店铺基本配置ID
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteConfigBaseByIds(Long[] configBaseIds) { return configBaseMapper.deleteConfigBaseByIds(configBaseIds); }
}
